home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-02 / fgl110c.zip / 09-03.C < prev    next >
Text File  |  1992-01-31  |  608b  |  35 lines

  1. #include <fastgraf.h>
  2. #include <stdio.h>
  3. #include <stdlib.h>
  4.  
  5. void main(void);
  6.  
  7. char triangle[] = {
  8.    0x55,0x55,0x40, 0x1A,0xA9,0x00, 0x06,0xA4,0x00,
  9.    0x01,0x90,0x00, 0x00,0x40,0x00
  10.    };
  11.  
  12. void main()
  13. {
  14.    int old_mode;
  15.  
  16.    if (fg_testmode(4,1) == 0) {
  17.       printf("This program requires a 320 ");
  18.       printf("x 200 CGA graphics mode.\n");
  19.       exit(1);
  20.       }
  21.  
  22.    old_mode = fg_getmode();
  23.    fg_setmode(4);
  24.  
  25.    fg_setcolor(7);
  26.    fg_rect(0,319,0,199);
  27.  
  28.    fg_move(156,101);
  29.    fg_drwimage(triangle,3,5);
  30.    fg_waitkey();
  31.  
  32.    fg_setmode(old_mode);
  33.    fg_reset();
  34. }
  35.